<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php

error_reporting(1);
$res_url="/phoenixResource/resource/res-type/4/id/";

//资源子系统
$res_s_url="http://127.0.0.1:8081";
//$url = "http://192.168.2.119:8080";


//搜索
$url = "http://127.0.0.1:8084";
$url = "http://192.168.2.119:8080";
// $url="http://public-api.pla.tuniu.org";
if (! $_GET ['op']) {
	
} else {
	$path = "/ror/phoenix/product/delete";
	$method = 'POST';
	// 删除
	$arr=array(5000140,5000141,5000142,5000143,5000144,5000145,5000146,5000147,5000148,5000149,5000150,5000151,5000152,5000153,5000154,5000155,5000156,5000157,5000158,5000159,5000160,5000161,5000162,5000163,5000164,5000165,5000166,5000167,5000168,5000169,5000170,5000171,5000172,5000173,5000174,5000594,5000595,5000895,5000896,5000897,5000898,5000899,5000900,5000901,5000902,5000903,5000904,5000905,5000906,5000907,5000908,5000909,5000910,5001856,5001857,5001858,5001859,5001943,5001944,5001945,5001997,5002000,5002395,5002396,5002397,5002398,5002595,5002596,5002597,5002598,5002599,5002600,5002601,5003068,5003069,5003070);
	for($i = 5000000; $i < 5006700; $i ++) {
		if(!in_array($i, $arr)){
			$prodcuts [] = $i;
		}
	}
}


$prodcuts=array_chunk ($prodcuts, 1000);
foreach ($prodcuts as $v){
	$context = stream_context_create ( array (
			'http' => array (
					'method' => $method,
					'content' => base64_encode ( urldecode ( json_encode ( $v ) ) )
			)
	) );
//	sleep(2);
	$end=json_decode(base64_decode(file_get_contents ( $url . $path, 0, $context ) ),true);
	 if(!$end['success']){
		 echo "<br>************************************************************<br>";
		var_dump( urldecode ( json_encode ( $v ) ) );
		 echo "<br>************************************************************<br>";
	 }else{
		echo "<br>{$end['success']}<br>";
	 }
 }

// var_dump ( $prodcuts );

function GetPlan($sql, &$conn) {
	
	$rs = mysql_query ( $sql, $conn );
	$data = array ();
	while ( ($row = mysql_fetch_assoc ( $rs )) != false ) {
		$data [] = $row;
	}
	mysql_free_Result ( $rs );
	return $data;
}
function GetRow($sql, &$conn) {
	$rs = mysql_query ( $sql, $conn );
	$row = mysql_fetch_assoc ( $rs );
	@mysql_free_Result ( $rs );
	return $row;
}
function Query($sql) {
	$res = mysql_query ( $sql );
	return $res;
}
?>